//
//  QRCodeViewController.swift
//  funcode
//
//  Created by Wan Jiading on 2017/10/24.
//  Copyright © 2017年 WanJiading. All rights reserved.
//

import UIKit

class QRCodeViewController: UIViewController {

    @IBOutlet weak var contentField: UITextField!
    @IBOutlet weak var qrCodeResultImageView: UIImageView!
    override func viewDidLoad() {
        super.viewDidLoad()
    }

    @IBAction func makeQRCodeBtnClick() {
        contentField.text = "https://www.google.com/search?q=CGContextSetInterpolationQuality+swift+not+found&oq=CGContextSetInterpolationQuality+swift+not+found&aqs=chrome..69i57.4092j0j7&sourceid=chrome&ie=UTF-8"
        if let image = QRCodeUtil.getQRCode(contentField.text!, qrCodeResultImageView.size.width) {
            qrCodeResultImageView.image = image
        }
    }
}
